<template>
  <el-select placeholder="请选择" v-model="selectedValue" @change="updateSelectors" @clear="removeTag" clearable
    style="width:80%">
    <el-option v-for="  option  in  item.selectOption " :key="option.selectId" :label="option.selectContent"
      :value="option.selectId" v-show="!option.disabled" />
    <el-option label="暂无可选选项" value="no" disabled />
  </el-select>
</template>

<script>
import { ref, computed, watch } from 'vue';

export default {
  props: {
    item: {
      type: Object,
      required: true
    },
  },
  setup(props, { emit }) {
    const selectedValue = ref(props.value);
    const updateSelectors = () => {
      emit('handleDisabledUnique');
    }
    function removeTag() {
      emit('onHandleCanSelectUnique');
    }
    watch(selectedValue, (newValue) => {
      emit('update:value', newValue);
    });

    return {
      selectedValue,
      updateSelectors,
      removeTag
    };
  }
};
</script>